package com.xbq.exceleditor

import android.content.Intent
import com.xbq.exceleditor.ui.BuyVipActivity
import com.xbq.exceleditor.ui.LoginActivity
import com.xbq.exceleditor.utils.FeatureEnum
import com.xbq.xbqsdk.XbqApplication
import com.xbq.xbqsdk.XbqSdk
import com.xbq.xbqsdk.core.ui.account.XbqLoginActivity
import dagger.hilt.android.HiltAndroidApp


@HiltAndroidApp
class MyApp : XbqApplication() {

    override fun onCreate() {
        super.onCreate()
        XbqSdk.application = "EXCEL_EDITOR"
        XbqSdk.baseUrl = "https://api.dzxiaoshipin.com"
        XbqSdk.apiPrefix = "xbq/api/"
        XbqSdk.privacyUrl = "https://api.dzxiaoshipin.com/xbqstatic/privacy/excel_editor.html"
        XbqSdk.vipAgreementUrl = "https://api.dzxiaoshipin.com/xbqstatic/privacy/vip_agreement.html"
        XbqSdk.collectedListUrl = "https://api.dzxiaoshipin.com/xbqstatic/privacy/excel_editor_personal.html"
        XbqSdk.sdkShareListUrl = "https://api.dzxiaoshipin.com/xbqstatic/privacy/excel_editor_other_sdk.html"
        XbqSdk.userAgreementUrl =
            "https://api.dzxiaoshipin.com/xbqstatic/useragreement/excel_editor.html"
        XbqSdk.debug = BuildConfig.DEBUG
        XbqSdk.innerVersion = "1"
        XbqSdk.featureDescriber = { name ->
            FeatureEnum.values().firstOrNull { it.name == name }?.desc ?: name
        }
        XbqSdk.loginActivityIntentFactory = { Intent(it,LoginActivity::class.java) }
        XbqSdk.mainActivityIntentFactory = { Intent(it, MainActivity::class.java) }
        XbqSdk.vipActivityIntentFactory = { context, feature ->
            BuyVipActivity.newIntent(context,feature)
        }
    }




}